home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
201-220
/
scopedisk214
/
skeleton
/
testclass.c
< prev
Wrap
C/C++ Source or Header
|
1995-03-19
|
1KB
|
57 lines
/*
* testclass - a stupidly simple progam to test the skeleton class
*
* Public Domain.
*
* Christian E. Hopps.
*
*/
#include <skeleton.h>
#include <proto/exec.h>
#include <proto/utility.h>
#include <proto/intuition.h>
struct Library *IntuitionBase = NULL;
struct Library *UtilityBase = NULL;
void main(int argc, char **argv);
void main(int argc, char **argv)
{
Class *SkeletonClass;
Object *skel_obj;
if(!( IntuitionBase = OpenLibrary("intuition.library",36) )) {
return;
} else if(!( UtilityBase = OpenLibrary("utility.library",36) )) {
CloseLibrary(IntuitionBase);
return;
} else if(!( SkeletonClass = Skeleton_init() )) {
CloseLibrary(IntuitionBase);
CloseLibrary(UtilityBase);
return;
}
/*
* Everything opened ok, try and get an object.
*/
if( skel_obj = NewObject(SkeletonClass,NULL,TAG_DONE) ) {
/*
* Got it, now dispose of it.
*/
Write(Output(),"skeleton class loaded, removing.\n",33);
DisposeObject(skel_obj);
} else {
/*
* Failed do a display beep.
*/
DisplayBeep(NULL);
}
Skeleton_free(SkeletonClass);
CloseLibrary(UtilityBase);
CloseLibrary(IntuitionBase);
return;
}